perm filename FOO.PUB[LSP,JRA]11 blob
sn#322649 filedate 1977-12-15 generic text, type T, neo UTF8
.Sec(Symbolic Expressions,Symbolic expressions)
.SS(Introduction)
.begin "int"
.FP
.group
With this introduction, here is %3complis%* and
friends:
.BOXA
.fp
%3complis <= λ[[u;off;vpl] complis%9'%*[u;off;off;vpl;();();();1]%1
.APART
.BOXA
.BEGIN turn on "\"; no fill;TABs 16,27,40;SELECT 3;TURN OFF "←";
.<<BEGIN turn on "\"; no fill;TABs 12,20,30;SELECT 3;TURN OFF "←";>>
.KRK
.GROUP
complis%9'%* <= λ[[u;org;off;vpl;triv;cmplx;pop;ac]
\[null[u] →\[null[cmplx] → triv;
\\ %et%* → append\[rest[cmplx];
\\\ list[mkmove[mem[first[pop]];1]];
\\\ rest[pop];
\\\ triv]];
.PT2;
.END
.BEGIN turn on "\"; no fill;TABs 16,27,46,67;SELECT 3;TURN OFF "←";
.<<BEGIN turn on "\"; no fill;TABs 12,23,36,63;SELECT 3;TURN OFF "←";>>
.GROUP
.KRK
\ isconst[first[u]] → complis%9'%*[\rest[u];
\\\org;
\\\off;
\\\vpl;
\\\concat[mkconst[ac;first[u]];triv];
\\\cmplx;
\\\pop;
\\\add1[ac]];
.PT2
.END
.BEGIN turn on "\"; no fill;TABs 16,27,44,51,58;SELECT 3;TURN OFF "←";
.<<BEGIN turn on "\"; no fill;TABs 12,23,33,63;SELECT 3;TURN OFF "←";>>
.KRK
.GROUP
\ isvar[first[u]] → complis%9'%*[\rest[u];
\\\org;
\\\off;
\\\vpl;
\\\concat[\mkvar[\ac;
\\\\\loc[first[u];off;vpl]];
\\\\triv];
\\\cmplx;
\\\pop;
\\\add1[ac]];
.PT2
.END
.BEGIN turn on "\"; no fill;TABs 16,27,47,56,76;sELECT 3;TURN OFF "←";
.<<BEGIN turn on "\"; no fill;TABs 16,27,47,56,70;SELECT 3;TURN OFF "←";>>
.GROUP
.KRK
\ iscarcdr[first[u]] → complis%9'%*[\rest[u];
\\\org;
\\\off;
\\\vpl;
\\\append[\reverse[compcarcdr[\ac;
\\\\\ first[u];
\\\\\ off;
\\\\\ vpl]];
\\\\triv];
\\\cmplx;
\\\pop;
\\\add1[ac]];
.PT2
.END
.BEGIN turn on "\"; no fill;TABs 16,28,45,54,61,70,76;SELECT 3;TURN OFF "←";
.<<BEGIN turn on "\"; no fill;TABs 16,28,45,54,61,70,72;SELECT 3;TURN OFF "←";>>
.KRK
.GROUP
\ iscond[first[u] → complis%9'%*[\rest[u];
\\\org;
\\\sub1[off];
\\\vpl;
\\\triv;
\\\append[\cmplx;
\\\\concat[\mkpush[1];
\\\\\comcond[\args%4c%3[\first[u]];
\\\\\\gensym[];
\\\\\\off;
\\\\\\vpl]]];
\\\concat[mkpop[ac];pop];
\\\add1[ac]];
.PT2
.END
.BEGIN turn on "\"; no fill;TABs 16,31,40,47,65,74;SELECT 3;TURN OFF "←";
.<<BEGIN turn on "\"; no fill;TABs 12,23,30,36,50,57;SELECT 3;TURN OFF "←";>>
.GROUP
.KRK
\ %et%* → complis%9'%*[\rest[u];
\\org;
\\sub1[off];
\\vpl;
\\triv;
\\append[\cmplx;
\\\concat[\mkpush[1];
\\\\λ[[z] compapply[\func[first[u]];
\\\\\complis[\z;
\\\\\\off;
\\\\\\vpl];
\\\\\length[z]]]
\\\\ [arglist[first[u]] ]];
\\concat[mkpop[ac];pop];
\\add1[ac]]]
.BOXB
.END
.BEGIN CENTERIT;SELECT 3;
.PT2
mkmove <= λ[[ac;loc][eq[ac;loc] → (); %et%* → list[MOVE;ac;loc]]]
.END
.BEGIN TABS 10,19,31,54;NOFILL;SELECT 3;TURN OFF "←";GROUP;TURN ON"\";
.<<BEGIN TABS 6,15,24,42;NOFILL;SELECT 3;TURN OFF "←";GROUP;TURN ON"\";>>
.BOXA
.KRK
compcarcdr <= λ[[ac;exp;off;vpl]
\\[isvar[arg[exp]] → list[mkcarcdr[\func[exp];
\\\\ac;
\\\\loc[arg[exp];off;vpl]]]
\\%Et%* → concat[\mkcarcdr_ac[func[exp];ac;ac];
\\\compcarcdr[ac;arg[exp];off;vpl]]]]
.BOXB
.APART
.GROUP
iscarcdr <=λ[[u]\[iscar[u] →iscarcdr[arg[u]]
\\ iscdr[u] →iscarcdr[arg[u]]
\\ atom[u] → or[isvar[u];isconst[u]];
\\ %et%* → %ef%* ]]
.BOXB
iscar <= λ[[x] eq[func[x];CAR]]
.PT2
iscdr <= λ[[x] eq[func[x];CDR]]
.PT2
mkcarcdr <=λ[[carcdr;ac;loc] list[carcdr;ac;loc]]
.END
.end "int"